import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable} from "rxjs/Observable";

@Injectable()
export class IndexProvider {

    constructor(public http: HttpClient) {
    }

    /*首页 获取设置已发布Banner信息*/
    getBannerList():Observable<any> {
        return this.http.get(`/banner/v1/app/homePage`);
    }

    //首页 获取预览Banner信息*/
    getBannerPreview():Observable<any>{
        return this.http.get(`/banner/v1/app/preview`);
    }

    /*首页 获取 头条 和 资讯*/
    getTopAndInformationList(): Observable<any>{
        return this.http.get(`/content/v1/app/homePage`);
    }

    /*获取头条 预览信息*/
    getPreviewHotList(): Observable<any>{
        return this.http.get(`/content/v1/app/preview/hot`);
    }

    /*获取资讯 预览信息*/
    getPreviewMsgList(): Observable<any>{
        return this.http.get(`/content/v1/app/preview`);
    }

    /*获取未读消息状态*/
    getUnReadMsg() {
        return this.http.get('/message/v1/app/hasUnReadMsg', {responseType: 'text'});
    }

    /*获取日程*/
    getRecentShedule() {
        // return this.http.get('./assets/json-data/index-shedule.json');
        return this.http.get('/reminderNew/v2/reminders/recently');
    }
}
